import Vue from 'vue'
import App from './App.vue'
import './styles/reset.css'
import './mobile/flexible.js'
// import './assets/download/font_mnx4tta273/iconfont.css'
import './assets/download/font_hctqi9wt6zi/iconfont.css'
import store from './store'

Vue.config.productionTip = false
// 路由----------------------------------------------------

import VueRouter from 'vue-router'
import Layout from '@/views/Layout/index.vue'
import Home from '@/views/Home/index.vue'
import Search1 from '@/views/Search/index.vue'
import Play from '@/views/Play/index.vue'
import P4 from '@/views/404.vue'
import Rege from '@/views/Hot/index.vue'
import SongFrom from '@/views/SongForm'
import GenDan from '@/views/Gedan/index.vue'
import LIST from '@/views/List'
// import Rege from '@/views/Hot/index.vue'
import less from 'less'
Vue.use(less)

import axios from 'axios'
axios.defaults.baseURL = "http://101.34.132.4:4000"
Vue.prototype.axios = axios
// Event bus
let bus = new Vue()
Vue.prototype.bus = bus



Vue.use(VueRouter)
const routes = [{
  path: '/',
  redirect: '/layout'
}, {
  path: '/layout',
  component: Layout,
  redirect: '/layout/home',
  children: [{
    path: 'home',
    component: Home
  }, {
    path: 'search',
    component: Search1
    },
    {
      path: 'rege',
      component: Rege
    },
    {
      path: 'gedan',
      component: GenDan
    },
    {
      path: 'list',
      component: LIST
      }
  ]
}, {
  path: '/play',
  component: Play,
  }, {
    path: '/songfrom',
  component: SongFrom,
  },{
  path: '*',
  component: P4,
}]
const router = new VueRouter({
  routes
})

// 自动按需引入------------------------------------------
import {
  Tabbar,
  TabbarItem,
  NavBar,
  Image as VanImage
} from 'vant';
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(NavBar);
Vue.use(VanImage);
import { Popup } from 'vant';

Vue.use(Popup);
import {
  Col,
  Row
} from 'vant';
import { Progress } from 'vant';

Vue.use(Progress);
Vue.use(Col);
Vue.use(Row);
import {
  Cell,
  CellGroup
} from 'vant';

Vue.use(Cell);
Vue.use(CellGroup);
import {
  Icon
} from 'vant';
Vue.use(Icon);

import {
  Search
} from 'vant';

Vue.use(Search);
import {
  List
} from 'vant';

Vue.use(List);
// --------------------------------------------------------------
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')